\(\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx\) [250]
Optimal result
Integrand size = 31, antiderivative size = 178 \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {\left (2 a^2+b^2\right ) (A b-a B) x}{2 b^4}-\frac {2 a^3 (A b-a B) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^4 \sqrt {a+b} d}-\frac {\left (3 a A b-3 a^2 B-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}
\]
[Out]
1/2*(2*a^2+b^2)*(A*b-B*a)*x/b^4-1/3*(3*A*a*b-3*B*a^2-2*B*b^2)*sin(d*x+c)/b^3/d+1/2*(A*b-B*a)*cos(d*x+c)*sin(d*
x+c)/b^2/d+1/3*B*cos(d*x+c)^2*sin(d*x+c)/b/d-2*a^3*(A*b-B*a)*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2)
)/b^4/d/(a-b)^(1/2)/(a+b)^(1/2)
Rubi [A] (verified)
Time = 0.56 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.00, number of
steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3069, 3128, 3102, 2814, 2738,
211} \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=-\frac {2 a^3 (A b-a B) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^4 d \sqrt {a-b} \sqrt {a+b}}+\frac {x \left (2 a^2+b^2\right ) (A b-a B)}{2 b^4}-\frac {\left (-3 a^2 B+3 a A b-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \sin (c+d x) \cos (c+d x)}{2 b^2 d}+\frac {B \sin (c+d x) \cos ^2(c+d x)}{3 b d}
\]
[In]
Int[(Cos[c + d*x]^3*(A + B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]
[Out]
((2*a^2 + b^2)*(A*b - a*B)*x)/(2*b^4) - (2*a^3*(A*b - a*B)*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])
/(Sqrt[a - b]*b^4*Sqrt[a + b]*d) - ((3*a*A*b - 3*a^2*B - 2*b^2*B)*Sin[c + d*x])/(3*b^3*d) + ((A*b - a*B)*Cos[c
+ d*x]*Sin[c + d*x])/(2*b^2*d) + (B*Cos[c + d*x]^2*Sin[c + d*x])/(3*b*d)
Rule 211
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 2814
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]
Rule 3069
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*B*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f*
x])^(n + 1)/(d*f*(m + n + 1))), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f
*x])^n*Simp[a^2*A*d*(m + n + 1) + b*B*(b*c*(m - 1) + a*d*(n + 1)) + (a*d*(2*A*b + a*B)*(m + n + 1) - b*B*(a*c
- b*d*(m + n)))*Sin[e + f*x] + b*(A*b*d*(m + n + 1) - B*(b*c*m - a*d*(2*m + n)))*Sin[e + f*x]^2, x], x], x] /;
FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m
, 1] && !(IGtQ[n, 1] && ( !IntegerQ[m] || (EqQ[a, 0] && NeQ[c, 0])))
Rule 3102
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Rule 3128
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)
*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*(a + b*Sin[e
+ f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n + 2))), x] + Dist[1/(d*(m + n + 2)), Int[(a + b*Sin[e + f*
x])^(m - 1)*(c + d*Sin[e + f*x])^n*Simp[a*A*d*(m + n + 2) + C*(b*c*m + a*d*(n + 1)) + (d*(A*b + a*B)*(m + n +
2) - C*(a*c - b*d*(m + n + 1)))*Sin[e + f*x] + (C*(a*d*m - b*c*(m + 1)) + b*B*d*(m + n + 2))*Sin[e + f*x]^2, x
], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d
^2, 0] && GtQ[m, 0] && !(IGtQ[n, 0] && ( !IntegerQ[m] || (EqQ[a, 0] && NeQ[c, 0])))
Rubi steps \begin{align*}
\text {integral}& = \frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}+\frac {\int \frac {\cos (c+d x) \left (2 a B+2 b B \cos (c+d x)+3 (A b-a B) \cos ^2(c+d x)\right )}{a+b \cos (c+d x)} \, dx}{3 b} \\ & = \frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}+\frac {\int \frac {3 a (A b-a B)+b (3 A b+a B) \cos (c+d x)-2 \left (3 a A b-3 a^2 B-2 b^2 B\right ) \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{6 b^2} \\ & = -\frac {\left (3 a A b-3 a^2 B-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}+\frac {\int \frac {3 a b (A b-a B)+3 \left (2 a^2+b^2\right ) (A b-a B) \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{6 b^3} \\ & = \frac {\left (2 a^2+b^2\right ) (A b-a B) x}{2 b^4}-\frac {\left (3 a A b-3 a^2 B-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}-\frac {\left (a^3 (A b-a B)\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{b^4} \\ & = \frac {\left (2 a^2+b^2\right ) (A b-a B) x}{2 b^4}-\frac {\left (3 a A b-3 a^2 B-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d}-\frac {\left (2 a^3 (A b-a B)\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = \frac {\left (2 a^2+b^2\right ) (A b-a B) x}{2 b^4}-\frac {2 a^3 (A b-a B) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^4 \sqrt {a+b} d}-\frac {\left (3 a A b-3 a^2 B-2 b^2 B\right ) \sin (c+d x)}{3 b^3 d}+\frac {(A b-a B) \cos (c+d x) \sin (c+d x)}{2 b^2 d}+\frac {B \cos ^2(c+d x) \sin (c+d x)}{3 b d} \\
\end{align*}
Mathematica [A] (verified)
Time = 0.94 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.85
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {6 \left (2 a^2+b^2\right ) (A b-a B) (c+d x)-\frac {24 a^3 (-A b+a B) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+3 b \left (-4 a A b+4 a^2 B+3 b^2 B\right ) \sin (c+d x)+3 b^2 (A b-a B) \sin (2 (c+d x))+b^3 B \sin (3 (c+d x))}{12 b^4 d}
\]
[In]
Integrate[(Cos[c + d*x]^3*(A + B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]
[Out]
(6*(2*a^2 + b^2)*(A*b - a*B)*(c + d*x) - (24*a^3*(-(A*b) + a*B)*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 +
b^2]])/Sqrt[-a^2 + b^2] + 3*b*(-4*a*A*b + 4*a^2*B + 3*b^2*B)*Sin[c + d*x] + 3*b^2*(A*b - a*B)*Sin[2*(c + d*x)
] + b^3*B*Sin[3*(c + d*x)])/(12*b^4*d)
Maple [A] (verified)
Time = 1.21 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.35
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {-\frac {2 a^{3} \left (A b -B a \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {\frac {2 \left (\left (-A a \,b^{2}-\frac {1}{2} A \,b^{3}+B \,a^{2} b +\frac {1}{2} B a \,b^{2}+B \,b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 A a \,b^{2}+2 B \,a^{2} b +\frac {2}{3} B \,b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A a \,b^{2}+B \,a^{2} b +B \,b^{3}+\frac {1}{2} A \,b^{3}-\frac {1}{2} B a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\left (2 A \,a^{2} b +A \,b^{3}-2 B \,a^{3}-B a \,b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{4}}}{d}\) |
\(240\) |
default |
\(\frac {-\frac {2 a^{3} \left (A b -B a \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {\frac {2 \left (\left (-A a \,b^{2}-\frac {1}{2} A \,b^{3}+B \,a^{2} b +\frac {1}{2} B a \,b^{2}+B \,b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 A a \,b^{2}+2 B \,a^{2} b +\frac {2}{3} B \,b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A a \,b^{2}+B \,a^{2} b +B \,b^{3}+\frac {1}{2} A \,b^{3}-\frac {1}{2} B a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\left (2 A \,a^{2} b +A \,b^{3}-2 B \,a^{3}-B a \,b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{4}}}{d}\) |
\(240\) |
risch |
\(\frac {x A \,a^{2}}{b^{3}}+\frac {x A}{2 b}-\frac {x B \,a^{3}}{b^{4}}-\frac {a B x}{2 b^{2}}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B \,a^{2}}{2 b^{3} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{2}}{2 b^{3} d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} A a}{2 b^{2} d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} B}{8 b d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} B}{8 b d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} A a}{2 b^{2} d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) A}{\sqrt {-a^{2}+b^{2}}\, d \,b^{3}}+\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, d \,b^{4}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) A}{\sqrt {-a^{2}+b^{2}}\, d \,b^{3}}-\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, d \,b^{4}}+\frac {B \sin \left (3 d x +3 c \right )}{12 b d}+\frac {\sin \left (2 d x +2 c \right ) A}{4 b d}-\frac {\sin \left (2 d x +2 c \right ) B a}{4 b^{2} d}\) |
\(515\) |
| | |
|
|
|
[In]
int(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+cos(d*x+c)*b),x,method=_RETURNVERBOSE)
[Out]
1/d*(-2*a^3*(A*b-B*a)/b^4/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2))+2/b^4*(((-A
*a*b^2-1/2*A*b^3+B*a^2*b+1/2*B*a*b^2+B*b^3)*tan(1/2*d*x+1/2*c)^5+(-2*A*a*b^2+2*B*a^2*b+2/3*B*b^3)*tan(1/2*d*x+
1/2*c)^3+(-A*a*b^2+B*a^2*b+B*b^3+1/2*A*b^3-1/2*B*a*b^2)*tan(1/2*d*x+1/2*c))/(1+tan(1/2*d*x+1/2*c)^2)^3+1/2*(2*
A*a^2*b+A*b^3-2*B*a^3-B*a*b^2)*arctan(tan(1/2*d*x+1/2*c))))
Fricas [A] (verification not implemented)
none
Time = 0.36 (sec) , antiderivative size = 541, normalized size of antiderivative = 3.04
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\left [-\frac {3 \, {\left (2 \, B a^{5} - 2 \, A a^{4} b - B a^{3} b^{2} + A a^{2} b^{3} - B a b^{4} + A b^{5}\right )} d x - 3 \, {\left (B a^{4} - A a^{3} b\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - {\left (6 \, B a^{4} b - 6 \, A a^{3} b^{2} - 2 \, B a^{2} b^{3} + 6 \, A a b^{4} - 4 \, B b^{5} + 2 \, {\left (B a^{2} b^{3} - B b^{5}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (B a^{3} b^{2} - A a^{2} b^{3} - B a b^{4} + A b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} b^{4} - b^{6}\right )} d}, -\frac {3 \, {\left (2 \, B a^{5} - 2 \, A a^{4} b - B a^{3} b^{2} + A a^{2} b^{3} - B a b^{4} + A b^{5}\right )} d x - 6 \, {\left (B a^{4} - A a^{3} b\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (6 \, B a^{4} b - 6 \, A a^{3} b^{2} - 2 \, B a^{2} b^{3} + 6 \, A a b^{4} - 4 \, B b^{5} + 2 \, {\left (B a^{2} b^{3} - B b^{5}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (B a^{3} b^{2} - A a^{2} b^{3} - B a b^{4} + A b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} b^{4} - b^{6}\right )} d}\right ]
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="fricas")
[Out]
[-1/6*(3*(2*B*a^5 - 2*A*a^4*b - B*a^3*b^2 + A*a^2*b^3 - B*a*b^4 + A*b^5)*d*x - 3*(B*a^4 - A*a^3*b)*sqrt(-a^2 +
b^2)*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 - 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x
+ c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) - (6*B*a^4*b - 6*A*a^3*b^2 - 2*B*a^2*b^3
+ 6*A*a*b^4 - 4*B*b^5 + 2*(B*a^2*b^3 - B*b^5)*cos(d*x + c)^2 - 3*(B*a^3*b^2 - A*a^2*b^3 - B*a*b^4 + A*b^5)*co
s(d*x + c))*sin(d*x + c))/((a^2*b^4 - b^6)*d), -1/6*(3*(2*B*a^5 - 2*A*a^4*b - B*a^3*b^2 + A*a^2*b^3 - B*a*b^4
+ A*b^5)*d*x - 6*(B*a^4 - A*a^3*b)*sqrt(a^2 - b^2)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c))
) - (6*B*a^4*b - 6*A*a^3*b^2 - 2*B*a^2*b^3 + 6*A*a*b^4 - 4*B*b^5 + 2*(B*a^2*b^3 - B*b^5)*cos(d*x + c)^2 - 3*(B
*a^3*b^2 - A*a^2*b^3 - B*a*b^4 + A*b^5)*cos(d*x + c))*sin(d*x + c))/((a^2*b^4 - b^6)*d)]
Sympy [F(-1)]
Timed out. \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\text {Timed out}
\]
[In]
integrate(cos(d*x+c)**3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c)),x)
[Out]
Timed out
Maxima [F(-2)]
Exception generated. \[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
for more de
Giac [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 360 vs. \(2 (161) = 322\).
Time = 0.29 (sec) , antiderivative size = 360, normalized size of antiderivative = 2.02
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=-\frac {\frac {3 \, {\left (2 \, B a^{3} - 2 \, A a^{2} b + B a b^{2} - A b^{3}\right )} {\left (d x + c\right )}}{b^{4}} + \frac {12 \, {\left (B a^{4} - A a^{3} b\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} b^{4}} - \frac {2 \, {\left (6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} b^{3}}}{6 \, d}
\]
[In]
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="giac")
[Out]
-1/6*(3*(2*B*a^3 - 2*A*a^2*b + B*a*b^2 - A*b^3)*(d*x + c)/b^4 + 12*(B*a^4 - A*a^3*b)*(pi*floor(1/2*(d*x + c)/p
i + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(a^2 - b^2)))/(sqrt(a
^2 - b^2)*b^4) - 2*(6*B*a^2*tan(1/2*d*x + 1/2*c)^5 - 6*A*a*b*tan(1/2*d*x + 1/2*c)^5 + 3*B*a*b*tan(1/2*d*x + 1/
2*c)^5 - 3*A*b^2*tan(1/2*d*x + 1/2*c)^5 + 6*B*b^2*tan(1/2*d*x + 1/2*c)^5 + 12*B*a^2*tan(1/2*d*x + 1/2*c)^3 - 1
2*A*a*b*tan(1/2*d*x + 1/2*c)^3 + 4*B*b^2*tan(1/2*d*x + 1/2*c)^3 + 6*B*a^2*tan(1/2*d*x + 1/2*c) - 6*A*a*b*tan(1
/2*d*x + 1/2*c) - 3*B*a*b*tan(1/2*d*x + 1/2*c) + 3*A*b^2*tan(1/2*d*x + 1/2*c) + 6*B*b^2*tan(1/2*d*x + 1/2*c))/
((tan(1/2*d*x + 1/2*c)^2 + 1)^3*b^3))/d
Mupad [B] (verification not implemented)
Time = 5.32 (sec) , antiderivative size = 4568, normalized size of antiderivative = 25.66
\[
\int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\text {Too large to display}
\]
[In]
int((cos(c + d*x)^3*(A + B*cos(c + d*x)))/(a + b*cos(c + d*x)),x)
[Out]
((tan(c/2 + (d*x)/2)*(A*b^2 + 2*B*a^2 + 2*B*b^2 - 2*A*a*b - B*a*b))/b^3 + (tan(c/2 + (d*x)/2)^5*(2*B*a^2 - A*b
^2 + 2*B*b^2 - 2*A*a*b + B*a*b))/b^3 + (4*tan(c/2 + (d*x)/2)^3*(3*B*a^2 + B*b^2 - 3*A*a*b))/(3*b^3))/(d*(3*tan
(c/2 + (d*x)/2)^2 + 3*tan(c/2 + (d*x)/2)^4 + tan(c/2 + (d*x)/2)^6 + 1)) + (atan((((2*a^2 + b^2)*(A*b - B*a)*((
8*tan(c/2 + (d*x)/2)*(A^2*b^9 - 8*B^2*a^9 - 3*A^2*a*b^8 + 16*B^2*a^8*b + 7*A^2*a^2*b^7 - 13*A^2*a^3*b^6 + 16*A
^2*a^4*b^5 - 16*A^2*a^5*b^4 + 16*A^2*a^6*b^3 - 8*A^2*a^7*b^2 + B^2*a^2*b^7 - 3*B^2*a^3*b^6 + 7*B^2*a^4*b^5 - 1
3*B^2*a^5*b^4 + 16*B^2*a^6*b^3 - 16*B^2*a^7*b^2 - 2*A*B*a*b^8 + 16*A*B*a^8*b + 6*A*B*a^2*b^7 - 14*A*B*a^3*b^6
+ 26*A*B*a^4*b^5 - 32*A*B*a^5*b^4 + 32*A*B*a^6*b^3 - 32*A*B*a^7*b^2))/b^6 + ((2*a^2 + b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